#region (c) 2009 Abdullin.com and Contributors

// Copyright (c) 2009 Abdullin.com and Contributors
// Site: http://abdullin.com/ncouch
// This code is released under the terms of the new BSD licence

#endregion

using System;
using NCouch.Model;

namespace NCouch.Json
{
	public sealed class ViewRegistrationSyntax<TValue>
	{
		readonly Action<Type> _registrator;

		public ViewRegistrationSyntax(Action<Type> registrator)
		{
			_registrator = registrator;
		}

		public void WithKey<TKey>(Func<TValue, TKey> selector)
		{
			_registrator(typeof (View<TKey, TValue>));
			_registrator(typeof (Row<TKey, TValue>));
		}
	}
}